# 删除生成的测试数据
from Lib.common.common_function import *
import os


def delete_result():
    # 获取result路径
    result_path = get_path() + '/result'
    # 获取路径下的所有文件
    del_file = os.listdir(result_path)
    # 删除所有的测试数据
    for filename in del_file:
        if filename.endswith('.txt') or filename.endswith('.json') or filename.endswith('.png'):
            # 删除测试文件
            del_file_path = os.path.join(result_path, filename)
            os.remove(del_file_path)


if __name__ == '__main__':
    delete_result()
